package com.my.basics.demo.demo01;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.util.CharsetUtil;
import lombok.extern.slf4j.Slf4j;

/**
 * @author mars
 * @date 2025-04-11 16:25
 */
@Slf4j
public class HelloNettyClientHandler extends SimpleChannelInboundHandler<ByteBuf> {
    @Override
    protected void messageReceived(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
        String msgStr = msg.toString(CharsetUtil.UTF_8);
        log.info("receive server msg : {}", msgStr);
    }
}
